package scala.mytrait

/**
 *  类加特质
 * @param name
 * @param age
 */
class User(var name :String,var age:Int)

trait userDao{
  _:User =>
  def insert: Unit={
    println("insert into db:" + this.name)
  }
}

class myUser(name:String,age:Int) extends User(name,age) with userDao with java.io.Serializable{

}


object mainTests{
  def main(args: Array[String]): Unit = {
    val user = new myUser("ff",33)
    user.insert
  }
}